<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/pintuer.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/admin.css">
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/toastr.css">
<script src="${pageContext.request.contextPath}/js/toastr.min.js"></script>
</head>
<body>
	<script type="text/javascript">
		$(function() {

		})
	</script>
	<script type="text/javascript">
		function view1(emId) {
			if (confirm("你确定删除教师的所有信息吗？该操作不可逆")) {
				$
						.ajax({
							type : "POST",
							url : "/ManagerSystem/manager/deleteTeacherMessage",
							data : {
								"user" : emId
							},
							success : function(data) {
								if (data.result == "删除成功") {
									toastr.options.positionClass = 'toast-center-center'
									toastr.success("删除成功,刷新页面生效");
								} else {
									toastr.options.positionClass = 'toast-center-center'
									toastr.error("删除失败");
								}
							}
						});
				return false;
			}
		}
		function update(data) {
			window.location.href = "/ManagerSystem/manager/enterUpdateTeacherMsg?emId="
					+ data
		}
		function view(title, date) {
			window.location.href = "/BookStoreManager/enterUpdateRightNews?title="
					+ title + "&date=" + date;
		}
	</script>
	<form method="post" action="" id="listform">
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder"> 新闻列表</strong> <a href=""
					style="float: right; display: none;">添加字段</a>
			</div>

			<table class="table table-hover text-center">
				<tr class="trHeader">
					<th width="200" style="padding-left: 20px;">新闻标题</th>
					<th width="200">发布日期</th>
					<th width="300">操作</th>
				</tr>
				<c:forEach items="${info}" var="msg">
					<tr class="tempTr">
						<td id="td"><c:out value="${msg.title}"></c:out></td>
						<td><c:out value="${msg.date}"></c:out></td>
						<td id="hello"><div class="button-group">
								<a class="button border-main" href="javascript:void(0)"
									onclick="view('${msg.title}','${msg.date}')"><span
									class="icon-edit"></span>查看</a> <a style="margin-left: 15px;"
									class="button border-red"
									href="${pageContext.request.contextPath}/deleteRightNews?title=${msg.title}&date=${msg.date}"><span
									class="icon-trash-o"></span> 删除</a>

							</div></td>
					</tr>

				</c:forEach>




			</table>

		</div>
		<div style="text-align: center;margin-top: 35px;" >
			<a class="button border-main"
				href="${pageContext.request.contextPath}/jsp/addIndexRightNews.jsp"
				onclick="update('${msg.title}')" style="margin-left: 15px;"><span
				class="icon-edit"></span> 添加新闻</a>
		</div>
	</form>

</body>
</html>